﻿using System;
using System.Windows.Forms;
using Oxage.Common;

namespace Oxage.Forms
{
	public partial class PromptForm : Form
	{
		#region Constructor
		public PromptForm()
		{
			InitializeComponent();
		}
		#endregion

		#region Event handlers
		private void btnOK_Click(object sender, EventArgs e)
		{
			OnResponse(txtInput.Text);
			this.Close();
		}

		private void btnCancel_Click(object sender, EventArgs e)
		{
			this.Close();
		}
		#endregion

		#region Bubble events
		public event EventHandler<EventArgs<string>> Response;
		protected virtual void OnResponse(string message)
		{
			if (Response != null)
			{
				Response(this, new EventArgs<string>(message));
			}
		}
		#endregion
	}
}
